package cn.stylefeng.guns.modular.business.service;


import cn.stylefeng.guns.base.pojo.node.TreeviewNode;
import cn.stylefeng.guns.base.pojo.node.ZTreeNode;
import cn.stylefeng.guns.modular.business.entity.Category;
import cn.stylefeng.guns.modular.business.model.result.CategoryFrontResultView;
import cn.stylefeng.guns.modular.business.model.result.CategoryResultView;
import cn.stylefeng.guns.modular.business.model.result.CategoryTypeView;
import cn.stylefeng.guns.modular.business.model.result.IndexResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;


public interface CategoryService extends IService<Category> {


    void addCategory(Category category);


    void editCategory(Category category);


    void deleteCategory(Long categoryId);


    List<ZTreeNode> tree();


    List<TreeviewNode> treeviewNodes();


    Page<Category> list(String condition, String categoryId);


    List<CategoryResultView> getCategories(Long categoryId, Boolean isAll);

    List<CategoryTypeView> getCategoriesType();

    void initCacheCategories();

    Category getCategoryById(Long categoryId);

    /**
     * 设置获取方式
     * @param categoryId
     * @param content
     */
    void setContent(Long categoryId, String content);

    /**
     * 查询所有的卡类和面值
     * @param categoryId
     * @return
     */
    List<CategoryFrontResultView> getCategoriesWithQuota(Long categoryId);

    /**
     * 设置热门
     * @param categoryId
     * @param hot
     * @return
     */
    boolean setHot(Long categoryId, Integer hot);

    /**
     * 设置上下架状态
     * @param categoryId
     * @param sellStatus
     * @return
     */
    boolean setSellStatus(Long categoryId, Integer sellStatus);

}
